package com.example.demo101;

import com.itextpdf.html2pdf.ConverterProperties;
import com.itextpdf.html2pdf.HtmlConverter;
import com.itextpdf.html2pdf.resolver.font.DefaultFontProvider;
import net.dongliu.apk.parser.ApkFile;
import net.dongliu.apk.parser.bean.ApkMeta;
import org.apache.tomcat.util.http.fileupload.IOUtils;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;

/**
 * PdfUtil
 *
 * @author lichao
 * @version 1.0.0
 * @since 2025/7/23 15:06
 */
public class PdfUtil {
  /*  public static void main(String[] args) throws Exception {
        // 配置字体（需提前将字体文件放入resources/fonts目录）
        ConverterProperties props = new ConverterProperties();
        DefaultFontProvider fontProvider = new DefaultFontProvider();
        fontProvider.addFont("fonts/simhei.ttf"); // 支持中文的黑体
        props.setFontProvider(fontProvider);
        URI uri = URI.create("https://news.baidu.com/");
        InputStream inputStream = uri.toURL().openStream();
        IOUtils.copy(inputStream,new FileOutputStream("d:\\1.html"));
        // 执行转换
        HtmlConverter.convertToPdf(
                "d:\\1.html",
                new FileOutputStream("D:\\1.pdf"),
                props
        );
    }*/

    public static void main(String[] args) throws IOException {
        ApkFile apkFile = new ApkFile("D:\\Download\\app-debug_202508211130.apk");
        ApkMeta apkMeta = apkFile.getApkMeta();
        System.out.println("");
    }
}
